#include "stdafx.h"
#include "StructureAndConst.h"
#include "SpriteGemMark.h"
#include "SpriteSingleFrame.h"
#include "SpriteMultiFrame.h"
#include "SpriteStaticPercent.h"
#include "DisplayController.h"

SpriteGemMark::SpriteGemMark(int nLayer):SpriteCombined(nLayer,true,false),
	m_pGemMarkBK(NULL),m_pGemMarkGroup(NULL),m_pGemMarkIndividual(NULL),
	m_fPercentGroup(0.0f),m_fPercentIndividual(0.0f)
{
	LPDIRECT3DTEXTURE9 pTexture=NULL;
	CREATE_SPRITE_SINGLE_FRAME(m_pGemMarkBK,ptCOLLECT_GEM_MARK_BACK,picCOLLECT_GEM_MARK_BACK,9,true,false,JUDGE_POINTER_RE_VOID);
	AddSprite(m_pGemMarkBK);

	CREATE_SPRITE_STATIC_PERCENT(m_pGemMarkGroup,ptCOLLECT_GEM_MARK_GROUP,picCOLLECT_GEM_MARK_GROUP,9,true,false,JUDGE_POINTER_RE_VOID);
	m_pGemMarkGroup->SetDispSide(eHitLeft);
	m_pGemMarkGroup->m_vPosition=posCOLLECT_GEM_MARK_GROUP;
	AddSprite(m_pGemMarkGroup);

	CREATE_SPRITE_STATIC_PERCENT(m_pGemMarkIndividual,ptCOLLECT_GEM_MARK_INDIVIDUAL,picCOLLECT_GEM_MARK_INDIVIDUAL,9,true,false,JUDGE_POINTER_RE_VOID);
	m_pGemMarkIndividual->SetDispSide(eHitLeft);
	m_pGemMarkIndividual->m_vPosition=posCOLLECT_GEM_MARK_INDIVIDUAL;
	AddSprite(m_pGemMarkIndividual);
}


SpriteGemMark::~SpriteGemMark(void)
{
	//base class will delete the points
}

bool SpriteGemMark::Draw( DWORD dwCurrentTime )
{
	m_pGemMarkGroup->SetDrawingPercent(m_fPercentGroup);
	m_pGemMarkIndividual->SetDrawingPercent(m_fPercentIndividual);
	
	SpriteCombined::Draw(dwCurrentTime);

	return true;
}